package com.syh.jn.scm.infrastructure.repository.model.base.goods;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 商品
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "T_BASE_GOODS")
@EqualsAndHashCode(callSuper = true)
public class GoodsModel extends SuperBusinessModel {
  /**
   * 商品名称
   */
  @Column(name = "NAME", columnDefinition = "varchar(100) COMMENT '商品名称'")
  private String name;
  /**
   * 编码
   */
  @Column(name = "CODE", columnDefinition = "varchar(50) COMMENT '编码'")
  private String code;
  /**
   * 供应商扩展编码
   */
  @Column(name = "EXT_CODE", columnDefinition = "varchar(50) COMMENT '供应商扩展编码'", length = 100)
  private String extCode;
  /**
   * 分类id
   */
  @Column(name = "CATEGORY_ID", columnDefinition = "bigint COMMENT '分类id'")
  private Long categoryId;
  /**
   * 所属种类,应用分类编码
   */
  @Column(name = "CATEGORY_CATALOG_CODE", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类的父类目录'", length = 50)
  private String categoryCatalogCode;
  /**
   * 所属种类,应用分类名称
   */
  @Column(name = "CATEGORY_NAME", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类名称'")
  private String categoryName;
  /**
   * 品牌id
   */
  @Column(name = "GOODS_BRAND_ID", columnDefinition = "bigint COMMENT '品牌id'")
  private Long goodsBrandId;
  /**
   * 产地id
   */
  @Column(name = "ORIGIN_ID", columnDefinition = "bigint COMMENT '产地id'")
  private Long originId;
  /**
   * 生产商id
   */
  @Column(name = "MANUFACTURER_ID", columnDefinition = "bigint COMMENT '生产商id'")
  private Long manufacturerId;
  /**
   * 规格
   */
  @Column(name = "SPEC_NAME", columnDefinition = "varchar(50) COMMENT '规格'")
  private String specName;
  /**
   * 计量单位
   */
  @Column(name = "UNITS", columnDefinition = "varchar(50) COMMENT '计量单位'")
  private String units;
  /**
   * 条码
   */
  @Column(name = "CODE_BAR", columnDefinition = "varchar(100) COMMENT '条码'")
  private String codeBar;
  /**
   * 是否可用: -1停用,1可用
   */
  @Column(name = "STATUS", columnDefinition = "smallint COMMENT '是否可用: -1停用,1可用'")
  private Short status;
  /**
   * 默认销售税率
   */
  @Column(name = "SALES_TAX_RATE", columnDefinition = "decimal(19,2) COMMENT '默认销售税率'")
  private BigDecimal salesTaxRate;
  /**
   * 默认采购税率
   */
  @Column(name = "PURCHASE_TAX_RATE", columnDefinition = "decimal(19,2) COMMENT '默认采购税率'")
  private BigDecimal purchaseTaxRate;
  /**
   * -1 辅助商品  1  基础商品
   */
  @Column(name = "IS_DEFAULT_GOODS", columnDefinition = "smallint COMMENT '-1 辅助商品  1  基础商品'")
  private Short isDefaultGoods;
  /**
   * 基础商品id （如果是基础商品 则指向他自己）
   */
  @Column(name = "DEFAULT_GOODS_ID", columnDefinition = "bigint COMMENT '基础商品id （如果是基础商品 则指向他自己）'")
  private Long defaultGoodsId;
  /**
   * 与基础商品转换率（如果是基础商品 则等于1）
   */
  @Column(name = "CONVERSION_RATE", columnDefinition = "decimal(19,2) COMMENT '与基础商品转换率（如果是基础商品 则等于1）'")
  private BigDecimal conversionRate;
  /**
   * 图片url,保存格式json字符串{"img":"www.test.com","img":"www.demo.com"}
   */
  @Column(name = "IMG_URL", columnDefinition = "varchar(1000) COMMENT ' 图片URL'")
  private String imgUrl;
  /**
   * 创建日期
   */
  @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
  private Long createTimeStamp;
  /**
   * 商品描述
   */
  @Column(name = "GOODS_DESCRIBE", columnDefinition = "varchar(500) COMMENT '商品描述'")
  private String goodsDescribe;
}
